<?php
/**
 * MVC_MODEL
 * @Version 3.0
 * date: 07May2008
 * 
 * @author: Thanh NV
 * email: sony_k48@yahoo.com
 * 
*/

class MVC_MODEL {
	/**
	 * All data request
	 *
	 * @var array $aData
	 */
	public $aData = array();
	
	/** 
	 * @var object page navigator 
	 * 
	 */
	public $oNavigator;
	/** 
	 * @var object Language 
	 * 
	 */
	public $oLang;
	public $aLanguage = array();
	/**
	 * @var string message
	 * 
	 */
	public $sMsg;
	/**
	 * @var string error message
	 * 
	 */
	public $sErrorMsg;
	
	public function __construct(){
		$this->setArrayData($_GET);
		$this->setArrayData($_POST);
	}
	
	function getLanguage($lang_file){
		$this->oLang = new MVC_Read_ini();
		$this->oLang->set_file($lang_file);
		$this->aLanguage = $this->oLang->parse();
	}
	/**
	 * setData
	 *
	 * @param unknown_type $sKey
	 * @param unknown_type $sValue
	 */
	public function setData($sKey, $sValue){
		$this->aData[$sKey] = $sValue;
	}
	
	public function unsetData($sKey){
		unset($this->aData[$sKey]);
	}
	/**
	 * setArrayData
	 *
	 * @param array $aDataInput
	 * @desc set data from array
	 */
	public function setArrayData($aDataInput){
		if (is_array($aDataInput)) {
			foreach ($aDataInput as $sKey=>$sValue){
				$this->aData[$sKey] = $sValue;
			}
		}
	}
	
	/**
	 * getAllData
	 *
	 * @return unknown
	 */
	public function getAllData(){
		return $this->aData;
	}
	/**
	 * getData
	 *
	 * @param string $sKey
	 * @return unknown
	 */
	public function getData($sKey){
		return $this->aData[$sKey];
	}
	
	
	public function setMsg($sMsg){ $this->sMsg = $sMsg; }
	public function getMsg(){ return $this->sMsg; }
	public function setErrorMsg($sErrorMsg){ $this->sErrorMsg = $sErrorMsg; }
	public function getErrorMsg(){ return $this->sErrorMsg; }
}
?>